package models

import (
	"time"
)

// MenuUserCheckin 用户打卡记录模型
type MenuUserCheckin struct {
	ID          uint      `gorm:"primaryKey;autoIncrement" json:"id"`
	UserID      int       `gorm:"type:int;not null;index:idx_user_date,unique;comment:关联menu_user.id" json:"user_id"`
	OrgId       int       `json:"org_id" gorm:"type:int;not null"`
	CheckinDate string    `gorm:"type:varchar;not null;index:idx_user_date,unique;comment:打卡日期" json:"checkin_date"`
	CheckinTime time.Time `gorm:"type:datetime;not null;comment:打卡时间" json:"checkin_time"`
	CreatedAt   time.Time `gorm:"type:datetime;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"`
}

// TableName 设置表名
func (MenuUserCheckin) TableName() string {
	return "menu_user_checkin"
}
